//Default autoButton
@btnHeight: 35px;
@btnLineHeight: 35px;
@yPosition: 0;
@btnPadding: 10px;

//Original Style
.abtn,
.abtn .in{background:url(../images/autobutton.png) no-repeat; display:inline-block; line-height:@btnLineHeight; }
.abtn{ background-position:0 @yPosition; padding-left:@btnPadding;}
.abtn .in{ background-position:right @yPosition; padding-right:@btnPadding;}

//Usage:
//.abtn-Style(v1,25px,25px,60px,10px);
//.abtn-Style(v2,25px,25px,80px,20px);
//.abtn-StyleFixedWith(v1,120px,10px);
.abtn-Style(v2,30px,30px,0,10px);

//@public
.abtn-Style(@v,@btnHeight,@btnLineHeight,@yPosition,@btnPadding){
  .heightLineHeight(@v,@btnHeight,@btnLineHeight);
  .commonBackgroundPadding(@v,@yPosition,@btnPadding);
}

//@public
.abtn-StyleFixedWith(@v,@btnWidth,@btnPadding){
  @fixWidth:@btnWidth - 2*@btnPadding;
  @fixName:unit(@btnWidth);
  .abtn.@{v}_w@{fixName} .in{
    width:@fixWidth;
   }
}

//@private
.heightLineHeight(@v,@height,@lineHeight){
  .abtn.@{v},
  .abtn.@{v} .in {
     height: @height;
     line-height: @lineHeight;
   }
}

//@private-override1
.commonBackgroundPadding(@v,@yPosition,@btnPadding) when(@btnPadding>10px),(@btnPadding<10px){
  .abtn.@{v} {
    background-position: 0 -@yPosition;
    padding-left: @btnPadding;
    .in {
      background-position: right -@yPosition;
      padding-right: @btnPadding;
    }
  }
}

//@private-override2
.commonBackgroundPadding(@v,@yPosition,@btnPadding) when(@btnPadding=10px){
  .abtn.@{v} {
    background-position: 0 -@yPosition;
    .in {
      background-position: right -@yPosition;
    }
  }
}